package com.salon.client.beans;

import java.util.ArrayList;
import java.util.List;

public class PriceBean extends ParentBean {
	private String name;
	private float cost;
	private List<IncomeMaterialsBean> list = null;
	
	
	public List<IncomeMaterialsBean> getList() {
		return list;
	}
	
	public void setList(List<IncomeMaterialsBean> list) {
		this.list = list;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public float getCost() {
		return cost;
	}
	
	public void setCost(float cost) {
		this.cost = cost;
	}
	
	public PriceBean clonePrice() {
		PriceBean clone = new PriceBean();
		clone.setId(getId());
		clone.setName(name);
		clone.setCost(cost);
		
		List<IncomeMaterialsBean> materials = new ArrayList<IncomeMaterialsBean>();
		for (IncomeMaterialsBean mat : list) {
			materials.add(mat.cloneMaterial());
		}
		
		clone.setList(materials);
		
		return clone;
	}
}
